import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '劳务人员姓名',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '身份证号',
    align:"center",
    dataIndex: 'idCard'
   },
   {
    title: '移民标识',
    align:"center",
    dataIndex: 'immiIden'
   },
   {
    title: '等级',
    align:"center",
    dataIndex: 'categoryLevel'
   },
   {
    title: '工种名称',
    align:"center",
    dataIndex: 'categoryName'
   },
   {
    title: '证书（文件地址）',
    align:"center",
    dataIndex: 'certificate'
   },
   {
    title: '联系电话',
    align:"center",
    dataIndex: 'phone'
   },
   {
    title: '性别',
    align:"center",
    dataIndex: 'gender'
   },
   {
    title: '民族',
    align:"center",
    dataIndex: 'ethnic'
   },
   {
    title: '户籍地址',
    align:"center",
    dataIndex: 'registerAddr'
   },
   {
    title: '紧急联系人姓名',
    align:"center",
    dataIndex: 'emergencyName'
   },
   {
    title: '紧急联系人人员关系',
    align:"center",
    dataIndex: 'emergencyReal'
   },
   {
    title: '紧急联系人电话',
    align:"center",
    dataIndex: 'emergencyPhone'
   },
   {
    title: '人员照片（照片地址）',
    align:"center",
    dataIndex: 'photos'
   },
   {
    title: '审核状态',
    align:"center",
    dataIndex: 'auditState'
   },
   {
    title: '人员评分',
    align:"center",
    dataIndex: 'rating'
   },
   {
    title: '人员所属公司',
    align:"center",
    dataIndex: 'companyId'
   },
   {
    title: '是否参保',
    align:"center",
    dataIndex: 'insured'
   },
   {
    title: '证书名称',
    align:"center",
    dataIndex: 'certificateName'
   },
   {
    title: '户号',
    align:"center",
    dataIndex: 'houseNumber'
   },
   {
    title: '人员状态',
    align:"center",
    dataIndex: 'status'
   },
   {
    title: '身份证正面照片',
    align:"center",
    dataIndex: 'idCardPositive'
   },
   {
    title: '身份证反面照片',
    align:"center",
    dataIndex: 'idCardOpposite'
   },
   {
    title: '户籍照片第一页',
    align:"center",
    dataIndex: 'housePicsPositive'
   },
   {
    title: '户籍照片第二页',
    align:"center",
    dataIndex: 'housePicsOpposite'
   },
   {
    title: '是否清退',
    align:"center",
    dataIndex: 'clearance'
   },
   {
    title: '清退到期时间',
    align:"center",
    dataIndex: 'clearanceTime'
   },
   {
    title: '工种id',
    align:"center",
    dataIndex: 'categoryId'
   },
   {
    title: '等级id',
    align:"center",
    dataIndex: 'categoryLevelId'
   },
   {
    title: '村民证明',
    align:"center",
    dataIndex: 'prove'
   },
   {
    title: '是否愿意培训',
    align:"center",
    dataIndex: 'isTraining'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '劳务人员姓名',
    field: 'name',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入劳务人员姓名!'},
          ];
     },
  },
  {
    label: '身份证号',
    field: 'idCard',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入身份证号!'},
          ];
     },
  },
  {
    label: '移民标识',
    field: 'immiIden',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入移民标识!'},
          ];
     },
  },
  {
    label: '等级',
    field: 'categoryLevel',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入等级!'},
          ];
     },
  },
  {
    label: '工种名称',
    field: 'categoryName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入工种名称!'},
          ];
     },
  },
  {
    label: '证书（文件地址）',
    field: 'certificate',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入证书（文件地址）!'},
          ];
     },
  },
  {
    label: '联系电话',
    field: 'phone',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入联系电话!'},
          ];
     },
  },
  {
    label: '性别',
    field: 'gender',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入性别!'},
          ];
     },
  },
  {
    label: '民族',
    field: 'ethnic',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入民族!'},
          ];
     },
  },
  {
    label: '户籍地址',
    field: 'registerAddr',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入户籍地址!'},
          ];
     },
  },
  {
    label: '紧急联系人姓名',
    field: 'emergencyName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入紧急联系人姓名!'},
          ];
     },
  },
  {
    label: '紧急联系人人员关系',
    field: 'emergencyReal',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入紧急联系人人员关系!'},
          ];
     },
  },
  {
    label: '紧急联系人电话',
    field: 'emergencyPhone',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入紧急联系人电话!'},
          ];
     },
  },
  {
    label: '人员照片（照片地址）',
    field: 'photos',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入人员照片（照片地址）!'},
          ];
     },
  },
  {
    label: '审核状态',
    field: 'auditState',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入审核状态!'},
          ];
     },
  },
  {
    label: '人员评分',
    field: 'rating',
    component: 'Input',
  },
  {
    label: '人员所属公司',
    field: 'companyId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入人员所属公司!'},
          ];
     },
  },
  {
    label: '是否参保',
    field: 'insured',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入是否参保!'},
          ];
     },
  },
  {
    label: '证书名称',
    field: 'certificateName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入证书名称!'},
          ];
     },
  },
  {
    label: '户号',
    field: 'houseNumber',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入户号!'},
          ];
     },
  },
  {
    label: '人员状态',
    field: 'status',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入人员状态!'},
          ];
     },
  },
  {
    label: '身份证正面照片',
    field: 'idCardPositive',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入身份证正面照片!'},
          ];
     },
  },
  {
    label: '身份证反面照片',
    field: 'idCardOpposite',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入身份证反面照片!'},
          ];
     },
  },
  {
    label: '户籍照片第一页',
    field: 'housePicsPositive',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入户籍照片第一页!'},
          ];
     },
  },
  {
    label: '户籍照片第二页',
    field: 'housePicsOpposite',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入户籍照片第二页!'},
          ];
     },
  },
  {
    label: '是否清退',
    field: 'clearance',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入是否清退!'},
          ];
     },
  },
  {
    label: '清退到期时间',
    field: 'clearanceTime',
    component: 'DatePicker',
    componentProps: {
       showTime:true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入清退到期时间!'},
          ];
     },
  },
  {
    label: '工种id',
    field: 'categoryId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入工种id!'},
          ];
     },
  },
  {
    label: '等级id',
    field: 'categoryLevelId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入等级id!'},
          ];
     },
  },
  {
    label: '村民证明',
    field: 'prove',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入村民证明!'},
          ];
     },
  },
  {
    label: '是否愿意培训',
    field: 'isTraining',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入是否愿意培训!'},
          ];
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];


// 高级查询数据
export const superQuerySchema = {
  name: {title: '劳务人员姓名',order: 0,view: 'text', type: 'string',},
  idCard: {title: '身份证号',order: 1,view: 'text', type: 'string',},
  immiIden: {title: '移民标识',order: 2,view: 'text', type: 'string',},
  categoryLevel: {title: '等级',order: 3,view: 'text', type: 'string',},
  categoryName: {title: '工种名称',order: 4,view: 'text', type: 'string',},
  certificate: {title: '证书（文件地址）',order: 5,view: 'text', type: 'string',},
  phone: {title: '联系电话',order: 6,view: 'text', type: 'string',},
  gender: {title: '性别',order: 7,view: 'text', type: 'string',},
  ethnic: {title: '民族',order: 8,view: 'text', type: 'string',},
  registerAddr: {title: '户籍地址',order: 9,view: 'text', type: 'string',},
  emergencyName: {title: '紧急联系人姓名',order: 10,view: 'text', type: 'string',},
  emergencyReal: {title: '紧急联系人人员关系',order: 11,view: 'text', type: 'string',},
  emergencyPhone: {title: '紧急联系人电话',order: 12,view: 'text', type: 'string',},
  photos: {title: '人员照片（照片地址）',order: 13,view: 'text', type: 'string',},
  auditState: {title: '审核状态',order: 14,view: 'number', type: 'number',},
  rating: {title: '人员评分',order: 15,view: 'text', type: 'string',},
  companyId: {title: '人员所属公司',order: 16,view: 'text', type: 'string',},
  insured: {title: '是否参保',order: 17,view: 'text', type: 'string',},
  certificateName: {title: '证书名称',order: 18,view: 'text', type: 'string',},
  houseNumber: {title: '户号',order: 19,view: 'text', type: 'string',},
  status: {title: '人员状态',order: 20,view: 'number', type: 'number',},
  idCardPositive: {title: '身份证正面照片',order: 21,view: 'text', type: 'string',},
  idCardOpposite: {title: '身份证反面照片',order: 22,view: 'text', type: 'string',},
  housePicsPositive: {title: '户籍照片第一页',order: 23,view: 'text', type: 'string',},
  housePicsOpposite: {title: '户籍照片第二页',order: 24,view: 'text', type: 'string',},
  clearance: {title: '是否清退',order: 25,view: 'number', type: 'number',},
  clearanceTime: {title: '清退到期时间',order: 26,view: 'datetime', type: 'string',},
  categoryId: {title: '工种id',order: 27,view: 'text', type: 'string',},
  categoryLevelId: {title: '等级id',order: 28,view: 'text', type: 'string',},
  prove: {title: '村民证明',order: 29,view: 'text', type: 'string',},
  isTraining: {title: '是否愿意培训',order: 30,view: 'number', type: 'number',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}